<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>usbps: xusbps_ch9_audio.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">usbps
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xusbps__ch9__audio_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xusbps_ch9_audio.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains the implementation of chapter 9 specific code for the example. </p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who       Date     Changes
</p>
<hr/>
<p>
1.0  pm         20/02/20 First release</pre><pre></pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a135fc516ea82eb4231418c28d36a0b4f"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbps__ch9__audio_8c.html#a135fc516ea82eb4231418c28d36a0b4f">XUsbPs_Ch9SetupDevDescReply</a> (u8 *BufPtr, u32 BufLen)</td></tr>
<tr class="memdesc:a135fc516ea82eb4231418c28d36a0b4f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the device descriptor for the device.  <a href="#a135fc516ea82eb4231418c28d36a0b4f">More...</a><br/></td></tr>
<tr class="separator:a135fc516ea82eb4231418c28d36a0b4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f03702dc3627ef29d13543b7f5eb351"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbps__ch9__audio_8c.html#a6f03702dc3627ef29d13543b7f5eb351">XUsbPs_Ch9SetupCfgDescReply</a> (u8 *BufPtr, u32 BufLen)</td></tr>
<tr class="memdesc:a6f03702dc3627ef29d13543b7f5eb351"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the configuration descriptor for the device.  <a href="#a6f03702dc3627ef29d13543b7f5eb351">More...</a><br/></td></tr>
<tr class="separator:a6f03702dc3627ef29d13543b7f5eb351"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c178fd005bf89027556067cd952cc62"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbps__ch9__audio_8c.html#a6c178fd005bf89027556067cd952cc62">XUsbPs_Ch9SetupStrDescReply</a> (u8 *BufPtr, u32 BufLen, u8 Index)</td></tr>
<tr class="memdesc:a6c178fd005bf89027556067cd952cc62"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns a string descriptor for the given index.  <a href="#a6c178fd005bf89027556067cd952cc62">More...</a><br/></td></tr>
<tr class="separator:a6c178fd005bf89027556067cd952cc62"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a72238ee80cba8facd72277ab2ec271de"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbps__ch9__audio_8c.html#a72238ee80cba8facd72277ab2ec271de">XUsbPs_SetConfiguration</a> (<a class="el" href="struct_x_usb_ps.html">XUsbPs</a> *InstancePtr, int ConfigIdx)</td></tr>
<tr class="memdesc:a72238ee80cba8facd72277ab2ec271de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes State of Core to USB configured State.  <a href="#a72238ee80cba8facd72277ab2ec271de">More...</a><br/></td></tr>
<tr class="separator:a72238ee80cba8facd72277ab2ec271de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f3de0049101ffbf7d6c92a55442e226"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbps__ch9__audio_8c.html#a6f3de0049101ffbf7d6c92a55442e226">XUsbPs_SetConfigurationApp</a> (<a class="el" href="struct_x_usb_ps.html">XUsbPs</a> *InstancePtr, <a class="el" href="struct_x_usb_ps___setup_data.html">XUsbPs_SetupData</a> *SetupData)</td></tr>
<tr class="memdesc:a6f3de0049101ffbf7d6c92a55442e226"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is called by Chapter9 handler when SET_CONFIGURATION command is received from Host.  <a href="#a6f3de0049101ffbf7d6c92a55442e226">More...</a><br/></td></tr>
<tr class="separator:a6f3de0049101ffbf7d6c92a55442e226"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4942a94ee10ae5832b33125aa184f9ab"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbps__ch9__audio_8c.html#a4942a94ee10ae5832b33125aa184f9ab">XUsbPs_SetInterfaceHandler</a> (<a class="el" href="struct_x_usb_ps.html">XUsbPs</a> *InstancePtr, <a class="el" href="struct_x_usb_ps___setup_data.html">XUsbPs_SetupData</a> *SetupData)</td></tr>
<tr class="memdesc:a4942a94ee10ae5832b33125aa184f9ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is called by Chapter9 handler when SET_CONFIGURATION command or SET_INTERFACE command is received from Host.  <a href="#a4942a94ee10ae5832b33125aa184f9ab">More...</a><br/></td></tr>
<tr class="separator:a4942a94ee10ae5832b33125aa184f9ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a6f03702dc3627ef29d13543b7f5eb351"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XUsbPs_Ch9SetupCfgDescReply </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>BufPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BufLen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns the configuration descriptor for the device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the Usb_DevData instance. </td></tr>
    <tr><td class="paramname">BufPtr</td><td>is the pointer to the buffer that is to be filled with the descriptor. </td></tr>
    <tr><td class="paramname">BufLen</td><td>is the size of the provided buffer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Length of the descriptor in the buffer on success. 0 on error. </dd></dl>

</div>
</div>
<a class="anchor" id="a135fc516ea82eb4231418c28d36a0b4f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XUsbPs_Ch9SetupDevDescReply </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>BufPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BufLen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns the device descriptor for the device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the Usb_DevData instance. </td></tr>
    <tr><td class="paramname">BufPtr</td><td>is pointer to the buffer that is to be filled with the descriptor. </td></tr>
    <tr><td class="paramname">BufLen</td><td>is the size of the provided buffer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Length of the descriptor in the buffer on success. 0 on error. </dd></dl>

</div>
</div>
<a class="anchor" id="a6c178fd005bf89027556067cd952cc62"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XUsbPs_Ch9SetupStrDescReply </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>BufPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BufLen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns a string descriptor for the given index. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the Usb_DevData instance. </td></tr>
    <tr><td class="paramname">BufPtr</td><td>is a pointer to the buffer that is to be filled with the descriptor. </td></tr>
    <tr><td class="paramname">BufLen</td><td>is the size of the provided buffer. </td></tr>
    <tr><td class="paramname">Index</td><td>is the index of the string for which the descriptor is requested.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Length of the descriptor in the buffer on success. 0 on error. </dd></dl>

</div>
</div>
<a class="anchor" id="a72238ee80cba8facd72277ab2ec271de"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XUsbPs_SetConfiguration </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_usb_ps.html">XUsbPs</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>ConfigIdx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Changes State of Core to USB configured State. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the Usb_DevData instance. </td></tr>
    <tr><td class="paramname">Ctrl</td><td>is a pointer to the Setup packet data.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS else XST_FAILURE</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a class="anchor" id="a6f3de0049101ffbf7d6c92a55442e226"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XUsbPs_SetConfigurationApp </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_usb_ps.html">XUsbPs</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_usb_ps___setup_data.html">XUsbPs_SetupData</a> *&#160;</td>
          <td class="paramname"><em>SetupData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is called by Chapter9 handler when SET_CONFIGURATION command is received from Host. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is pointer to Usb_DevData instance. </td></tr>
    <tr><td class="paramname">SetupData</td><td>is the setup packet received from Host.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful,</li>
<li>XST_FAILURE if unsuccessful.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Non control endpoints must be enabled after SET_CONFIGURATION command since hardware clears all previously enabled endpoints except control endpoints when this command is received. </dd></dl>

</div>
</div>
<a class="anchor" id="a4942a94ee10ae5832b33125aa184f9ab"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XUsbPs_SetInterfaceHandler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_usb_ps.html">XUsbPs</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_usb_ps___setup_data.html">XUsbPs_SetupData</a> *&#160;</td>
          <td class="paramname"><em>SetupData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is called by Chapter9 handler when SET_CONFIGURATION command or SET_INTERFACE command is received from Host. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is pointer to Usb_DevData instance. </td></tr>
    <tr><td class="paramname">SetupData</td><td>is the setup packet received from Host.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Non control endpoints must be enabled after SET_INTERFACE command since hardware clears all previously enabled endpoints except control endpoints when this command is received. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
